// globals are declared outside all other scopes.
static LANGUAGE: &str = "Rust";
// if we don't specify the type of THRESHOLD
// there will be a compile time error:
// missing type for `const` item
// const THRESHOLD = 10;
const THRESHOLD: i32 = 10;

fn is_big(n: i32) -> bool {
    n > THRESHOLD
}

fn main() {
    let n = 16;
    // access constant in the main thread
    println!("This is {}", LANGUAGE);
    println!("The threshold is {}", THRESHOLD);
    println!("{} is {}", n, if is_big(n) {"big"} else {"small"});

    // Error! cannot modify a `const`.
    // THRESHOLD = 5;
    // FIXME ^ Comment out this line
}